const path = require('path')
// const HTMLPlugin = require("html-webpack-plugin")

module.exports = {
  target: 'web',
  mode: process.env.NODE_ENV === "production" ? "production" : "development",
  entry: path.resolve(__dirname,"../src/index.js"),
  output: {
    filename: "index.js",
    path: path.resolve(__dirname,"../dist-client"),
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: '/node_modules/',
      },
    ],
  },
  // plugins:  [
  //   new HTMLPlugin({
  //     template: path.join(__dirname,'../src/index.html'), // 在webpack构建后生成html文件，同时把构建好入口js文件引入到生成的html文件中。
  //   })
  // ],
}
